package com.xiaoyi.ui.activity;

import android.content.Context;

import com.xiaoyi.ui.view.lodingdialog.LoadingDialog;
import com.xiaoyi.ui.view.lodingdialog.LoadingDialog2;

import me.yokeyword.fragmentation.SupportActivity;

/**
 * @author Aivin , on 2019/1/3.
 */

public abstract class BaseActivity  extends SupportActivity {

    private LoadingDialog loadingDialog;
    public void showLoadDialog(Context context  ) {
        if (loadingDialog == null) {
            loadingDialog = new LoadingDialog(context);
        }
        loadingDialog.show();
        loadingDialog.setMsg("正在获取");
    }

    public void hideLoadDialog() {
        if (loadingDialog != null) {
            loadingDialog.dismiss();
        }
    }


    private LoadingDialog2 loadingDialog2;
    public void showLoadDialog2(Context context  ) {
        if (loadingDialog2 == null) {
            loadingDialog2 = new LoadingDialog2(context);
        }
        loadingDialog2.show();
        loadingDialog2.setMsg("加载中");
    }

    public void hideLoadDialog2() {
        if (loadingDialog2 != null) {
            loadingDialog2.dismiss();
        }
    }
}
